package cz.muni.fi.pv168.uloha3.entities;

import java.math.BigDecimal;
import java.sql.Date;

public class Ownership {
    
    private Long id;
    private Owner owner;
    private RealEstate realEstate;
    private java.sql.Date dateCreated;
    private java.sql.Date dateEnded;
    private BigDecimal investment;

    public Ownership() {
        this.dateCreated = new Date(System.currentTimeMillis());
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Owner getOwner() {
        return owner;
    }

    public void setOwner(Owner owner) {
        this.owner = owner;
    }

    public RealEstate getRealEstate() {
        return realEstate;
    }

    public void setRealEstate(RealEstate realEstate) {
        this.realEstate = realEstate;
    }

    public Date getDateCreated() {
        return dateCreated;
    }
    
    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public Date getDateEnded() {
        return dateEnded;
    }

    public void setDateEnded(Date dateEnded) {
        this.dateEnded = dateEnded;
    }

    public BigDecimal getInvestment() {
        return investment;
    }

    public void setInvestment(BigDecimal investment) {
        this.investment = investment;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Ownership other = (Ownership) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Ownership{" + "id=" + id + ", owner=" + owner + ", realEstate=" + realEstate + ", dateCreated=" + dateCreated + ", dateEnded=" + dateEnded + ", investment=" + investment + '}';
    }

}
